/**
 *
 * @author 朱雀
 */
Ext.define('SvgEditor.canvas.Quickbar', {
	extend: 'Ext.toolbar.Toolbar',
	canvas: null,
	initComponent: function() {
		var me = this;
		me.initQuickBtn(me);
		me.items = me.quickBtn;
		me.callParent();
	},
	initQuickBtn: function(me) {
		me.quickBtn = [
			{
				name: 'copy',
				text: '复制',
				canvas: me.canvas,
				handler: me.doOperation
			},
			{
				name: 'paste',
				text: '粘贴',
				canvas: me.canvas,
				handler: me.doOperation
			},
			{
				name: 'removeModel',
				text: '删除',
				canvas: me.canvas,
				handler: me.doOperation
			}
		];
	},
	doOperation: function() {
		var operation = this.name, canvas = this.canvas;
		canvas[operation](canvas);
	}
});